//
//  PageItemView.m
//  神约
//
//  Created by qlwl on 17/1/20.
//  Copyright © 2017年 qlwl. All rights reserved.
//

#import "PageItemView.h"
#import "UIView+FrameKIt.h"

@interface PageItemView ()


@end

@implementation PageItemView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initViews];
    }
    return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initViews];
    }
    return self;
}

- (void) initViews
{
    [self clipsToBounds];
    _titLab = [[UILabel alloc] initWithFrame:CGRectZero];
    _titLab.textColor = [UIColor blackColor];
    _titLab.textAlignment = NSTextAlignmentCenter;
    _titLab.font = [UIFont systemFontOfSize:13];
    _btn = [UIButton buttonWithType:UIButtonTypeCustom];
    _btn.frame = CGRectZero;
    [self addSubview:_titLab];
    [self addSubview:_btn];
}

- (void) layoutSubviews
{
    [super layoutSubviews];
    [_btn sizeToFit];
    _btn.center = CGPointMake(self.f_width/2, self.f_height/2 - 8);
    [_titLab sizeToFit];
    _titLab.frame = CGRectMake(0, _btn.f_bottom + 3, self.f_width, _titLab.f_height);
}

@end
